package demo.service;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * Created by 张少昆 on 2017/8/7.
 */
public class RemoteServiceImpl extends UnicastRemoteObject implements RemoteService {
    private String name;
    /**
     * Creates and exports a new UnicastRemoteObject object using an
     * anonymous port.
     * <p>
     * <p>The object is exported with a server socket
     * created using the {@link RMISocketFactory} class.
     *
     * @throws RemoteException if failed to export object
     * @since JDK1.1
     */
    public RemoteServiceImpl(String name) throws RemoteException{ //必须
        this.name = name;
    }



    // @Override
    public String a(){
        return "server >> a()";
    }

    @Override
    public String test(String content) throws RemoteException{
        return "server >> "+content;
    }
}
